// run: $exec < input
// opt: 0
// flag: -g
#include <iostream>

template <class T>
T gcd(T x, T y) { return !y ? x : gcd(y, x % y); }

long long n, x, y;
long long lastx, lasty, dx, dy, a;

bool judge(long long mid)
{
	long long attack = ((mid - lastx) / dx) * 1 + ((mid - lasty) / dy) * 1;
	return attack >= a;
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n >> x >> y;
	long long lcm = x * y / gcd(x, y);
	dx = lcm / x; dy = lcm / y;
	for (int i = 0; i < n; i++) {
		std::cin >> a;
		lastx = 0; lasty = 0;
		long long l = std::max(lastx, lasty), r = (1ll) << 50;
		while (l + 1 < r) {
			long long mid = (l + r) / 2;
			if (judge(mid)) r = mid;
			else l = mid;
		}
		if (judge(l)) r = l;
		long long tx = lastx + ((r - lastx) / dx) * dx;
		long long ty = lasty + ((r - lasty) / dy) * dy;
		if (tx == ty) std::cout << "Both";
		else if (tx > ty) std::cout << "Vanya";
		else if (tx < ty) std::cout << "Vova";
		lastx = tx % lcm;
		lasty = ty % lcm;
		std::cout << "\n";
//		std::cout << "t = " << r << "  "; std::cout << "lx = " << lastx << "  ly = " << lasty << "\n";
	}
}

